<!DOCTYPE html>
<html>
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>规则编辑</title>
	<link href="../../static/css/engine.css" rel="stylesheet">
	<script src="/bower_components/requirejs/require.js" data-main="/static/app.js"
			data-bootstrap-modules="'system/rule/RuleModule'"></script>
</head>
<body ng-controller="RuleController">
<div id="engine-container">
	<!--头部-->
	<div id="engine-header">
		<!--logo-->
		<div class="engine-logo">
			<img src="../../static/images/logo.png" style="vertical-align:bottom">
			<span class="system-name">规则引擎管理系统</span>
		</div>
		<!--logo结束-->
		<!--按钮组-->
		<ul class="engine-button-group">
			<li><button type="button" class="engine-btn-default"><i class="icon-engine-compile"></i>编译</button></li>
			<li><button type="button" class="engine-btn-default"><i class="icon-engine-test"></i>测试</button></li>
			<li><button type="button" class="engine-btn-default"><i class="icon-engine-release"></i>发布</button></li>
		</ul>
		<!--按钮组结束-->
		<!--用户设置-->
		<ul class="engine-header-r">
			<li><button type="button" class="engine-btn-default"><i class="icon-engine-monitor"></i>监控</button></li>
			<li class="user">
				<a href="#">
					<span><img src="../../static/images/user.png" style="vertical-align:middle;"></span>
					<span>zhoujl</span>
					<span><i class="icon-engine-down-a"></i></span>
				</a>
			<li>
		</ul>
		<!--用户设置结束-->
		<div class="clear"></div>
	</div>
	<!--头部结束-->
	<!--内容-->
	<div id="engine-content">
		<!--左列-->
		<div class="sidebar-left">
			<!--项目浏览-->
			<div class="project-browse">
				<div class="project-browse-l">项目浏览</div>
				<div class="project-browse-r"><a href="#"><i class="icon-engine-set"></i></a></div>
				<div class="clear"></div>
			</div>
			<!--项目浏览结束-->
			<!--选择项目-->
			<div class="select-project">
				<div class="select-project-l">会员</div>
				<div class="select-project-r"><a href="#"><i class="icon-engine-down-b"></i></a></div>
				<div class="clear"></div>
			</div>
			<!--选择项目结束-->
			<!--会员积分-->
			<div class="select-project" style="height:65px;">
				<div class="select-project-top">
					<div class="select-project-l">会员积分</div>
					<div class="select-project-r"><a href="#"><i class="icon-engine-down-b"></i></a></div>
					<div class="clear"></div>
				</div>
				<div class="select-project-bottom">
					<a href="#"><img src="../../static/images/intersection.png"></a>
					<a href="#"><img src="../../static/images/rule.png"></a>
					<a href="#"><img src="../../static/images/tree.png"></a>
					<a href="#"><img src="../../static/images/surface.png"></a>
				</div>
			</div>
			<!--会员积分结束-->
			<!--规则包配置标题-->
			<div class="project-title">规则包配置：</div>
			<!--规则包配置标题结束-->
			<!--菜单-->
			<ul class="engine-menu">
				<li class="menu-one"><a href="#"><i class="icon-engine-list"></i>积分规则集</a>
					<ul>
						<li><a href="#">会员购买总费用</a></li>
						<li><a href="#">会员购买总笔数>10</a></li>
						<li><a href="#">会员入会时间<2y</a></li>
					</ul>
				</li>
				<li class="menu-one"><a href="#"><i class="icon-engine-list"></i>特殊商品积分规则集</a></li>
				<li class="menu-one"><a href="#"><i class="icon-engine-list"></i>换购规则集</a>
					<ul>
						<li><a href="#">换购商品</a></li>
						<li><a href="#">换购条件</a></li>
					</ul>
				</li>
				<li class="menu-one"><a href="#"><i class="icon-engine-list"></i>积分换购礼品决策表</a></li>
			</ul>
			<!--菜单结束-->
		</div>
		<!--左列结束-->
		<!--右列-->
		<div class="sidebar-right">
			<!--标题-->
			<div class="sidebar-right-title">
				<div class="sidebar-right-title-l"> [规则] 会员购买总费用*</div>
				<div class="sidebar-right-title-r"><button type="button" class="engine-btn-success" ng-click="save()"><i class="icon-engine-preservation"></i>保存</button></div>
				<div class="clear"></div>
			</div>
			<!--标题结束-->
			<!--页签-->
			<div class="engine-tab">
				<ul>
					<li class="on">规则编辑</li>
					<li><a href="#">规则变量</a></li>
					<li><a href="#">规则设置</a></li>
				</ul>
			</div>
			<!--页签结束-->
			<!--详细内容-->
			<div class="engine-tab-content">
				<!--详细内容左列-->
				<div class="engine-tab-content-l">
					<!--添加-->
					<div class="add"></div>
					<div class="clear"></div>
					<!--添加结束-->
					<!--进入条件-->
					<div class="entry" id="condition">
						<div class="entry-title">如果<span style="float: right;"><a href="#" ng-click="addConditionRow()"><i class="icon-engine-plus"></i></a></span></div>
					</div>
					<!--进入条件-->
					<!--添加-->

					<div class="clear"></div>
					<!--添加结束-->
					<!--进入条件-->
					<div class="entry" id = "then">
						<div class="entry-title" >那么 <span style="float: right"><a href="#"  ng-click="addThen()"><i class="icon-engine-plus" style="text-align: right"></i></a></span></div>
					</div>
					<!--进入条件-->
					<!--添加-->
				<!--	<div class="add"><a href="#"><i class="icon-engine-plus"></i></a></div>-->
					<div class="clear"></div>
					<!--添加结束-->
					<!--进入条件-->
					<!--<div class="entry">
						<div class="entry-title">退出条件 <span style="float: right"><a href="#"  ng-click="addThen()"><i class="icon-engine-plus" style="text-align: right"></i></a></span></div>
						&lt;!&ndash;条件设置&ndash;&gt;
						<div class="entry-set">
							<div class="nub">1</div>
							<div class="entry-set-l">
								<span class="attribute"><a href="#">creditHistory</a></span>
								<span class="attribute"><a href="#">大于</a></span>
								<span class="attribute"><a href="#">200</a></span>
								<span class="attribute"><a href="#">或者</a></span>
								<span><button type="button" class="engine-btn-default">点击选择</button></span>
							</div>
							<div class="entry-set-r">
								<span><a href="#">()</a></span>
								<span><a href="#">&nbsp;-</a></span>
							</div>
							<div class="clear"></div>
						</div>
						&lt;!&ndash;条件设置结束&ndash;&gt;
					</div>-->
					<!--进入条件-->
				</div>
				<!--详细内容左列结束-->
				<!--详细内容右列-->
				<div class="engine-tab-content-r">
					<div ng-show="showNone">
						<div class="remind-r">
							<div class="tu"><i class="icon-engine-remind"></i></div>
							<div class="text">请单击条件选择框进行编辑。</div>
							<div class="clear"></div>
						</div>
					</div>
					<div ng-show="showAllCondition">
						<div class="engine-condition">
							<ul>
								<li class="on" name="column" id="property"><a href="#" ng-click="show('property')">模型</a></li>
								<li name="column" id="entry"><a href="#" ng-click="show('entry')">输入值</a></li>
								<li name="column" id="sign"><a href="#" ng-click="show('sign')">符号</a></li>
								<li name="column" id="variable"><a href="#" ng-click="show('variable')">变量</a></li>
								<li name="column" id="method"><a href="#" ng-click="show('method')">方法</a></li>

							</ul>
						</div>
						<!--条件结束-->
						<!--属性值-->
						<div class="engine-attribute" ng-show="showProperty">
							<!--业务模型-->
							<div class="model">
								<div class="model-l">业务模型</div>
								<div class="model-r"><a href="#"><i class="icon-engine-search"></i></a></div>
								<div class="clear"></div>
							</div>
							<div class="model-value">
								<table width="100%">
									<tr ng-repeat="modelAttribute in modelAttributes">
										<td ng-if="modelAttribute.dataType!='Object'">
											<div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addModel(modelAttribute.name)">{{modelAttribute.dataType}}</button></div>
											<div class="model-value-r">{{modelAttribute.name}}</div>
											<div class="clear"></div>
										</td>
										<td ng-if="modelAttribute.dataType=='Object'">
											<div class="model-value-l"><button type="button" class="engine-btn-model" id="{{modelAttribute.id}}" ng-click="viewObject(modelAttribute.id,1)">对象[+]</button></div>
											<div class="model-value-r">{{modelAttribute.name}}</div>
											<div class="clear"></div>
											<div id="son{{modelAttribute.id}}" ></div>
										</td>
									</tr>
								</table>
							</div>

						</div>

						<div class="engine-attribute" ng-show="showEntry">
							<!--输入值-->
							<div class="value">
								<div class="engine-form-group">
									<label>输入值</label>
									<textarea cols="47" rows="10" ng-model="textEntry"></textarea>
								</div>
								<button type="button" class="engine-btn-default" ng-click="addEntry()">确定</button>
							</div>
							<!--输入值结束-->
						</div>

						<div class="engine-attribute" ng-show="showMethod">
							<!--输入值-->
							<div class="model-value">
								<div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('addHours')">确定</button></div>
								<div class="model-value-r">加 &nbsp;<input type="text" id = "addHours" style="width: 20px"/>&nbsp; 小时</div>
								<div class="clear"></div>
							</div>
							<div class="model-value">
								<div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('lastDateTime','当天最后时间')">确定</button></div>
								<div class="model-value-r">当天最后时间</div>
								<div class="clear"></div>
							</div>
							<div class="model-value">
								<div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('nowDate','当前时间')">确定</button></div>
								<div class="model-value-r">当天开始时间</div>
								<div class="clear"></div>
							</div>
							<div class="model-value">
								<div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('setKey','')">确定</button></div>
								<div class="model-value-r">临时变量：<input type="text" id = "setKey" style="width: 100px"/></div>
								<div class="clear"></div>
							</div>
							<!--输入值结束-->
						</div>


						<div class="engine-attribute" ng-show="showVariable">
							<div class="model-value">
								<table width="100%">
									<tr ng-repeat="variable in variables">
										<td>
											<div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addVariable(variable.varName)">变量</button></div>
											<div class="model-value-r">{{variable.varName}}</div>
											<div class="clear"></div>
										</td>
									</tr>
								</table>
							</div>
						</div>

						<div class="engine-attribute" ng-show="showSign">
							<!--符号-->
							<div class="symbol">
								<!--<div class="symbol-tit">逻辑运算符</div>
								<div class="symbol-but">
									<button type="button" ng-click="addSign('&&')"  class="engine-btn-symbol">并且</button>
									<button type="button" ng-click="addSign('||')" class="engine-btn-symbol">或者√</button>
								</div>-->
								<div class="symbol-tit">比较符</div>
								<div class="symbol-but">
									<button type="button" ng-click="addSign('<')" class="engine-btn-symbol">小于</button>
									<button type="button" ng-click="addSign('==')" class="engine-btn-symbol">等于</button>
									<button type="button" ng-click="addSign('>')" class="engine-btn-symbol">大于</button>
									<button type="button" ng-click="addSign('<=')" class="engine-btn-symbol">小于等于</button>
									<button type="button" ng-click="addSign('!=')" class="engine-btn-symbol">不等于</button>
									<button type="button" ng-click="addSign('>=')" class="engine-btn-symbol">大于等于</button>
								</div>
								<div class="symbol-tit">数值运算符</div>
								<div class="symbol-but">
									<button type="button"  ng-click="addSign('+')" class="engine-btn-symbol">+</button>
									<button type="button"  ng-click="addSign('-')"class="engine-btn-symbol">-</button>
									<button type="button" ng-click="addSign('*')" class="engine-btn-symbol">*</button>
									<button type="button"  ng-click="addSign('/')" class="engine-btn-symbol">/</button>
								</div>
								<div class="symbol-tit">数值运算符</div>
								<div class="symbol-but">
									<button type="button" ng-click="addSign('(')" class="engine-btn-symbol">(</button>
									<button type="button" ng-click="addSign(')')" class="engine-btn-symbol">)</button>

								</div>
							</div>
							<!--符号结束-->
						</div>
						<!--属性值结束-->
						<div class="clear"></div>
					</div>

				</div>
				<!--详细内容右列结束-->
				<div class="clear"></div>
			</div>
			<!--详细内容结束-->
		</div>
		<!--右列结束-->
	</div>
	<!--内容结束-->
</div>
</body>
</html>